using System;
using Cysharp.Threading.Tasks;

namespace EventBus
{
    /// <summary>
    /// 监听方是Action的方式异步处理事件
    /// </summary>
    public interface IEventListenerActionAsync
    {
        /// <summary>
        /// 以异步回调的方式处理监听的事件， 并提供返回值
        /// </summary>
        /// <param name="eventName">事件名</param>
        /// <param name="callback">异步回调函数</param>
        /// <typeparam name="TResult">返回值的类型</typeparam>
        void Listen(string eventName, Func<UniTask> callback);
        void Listen<T>(string eventName, Func<T, UniTask> callback);
        void Listen<T1, T2>(string eventName, Func<T1, T2, UniTask> callback);
        void Listen<T1, T2, T3>(string eventName, Func<T1, T2, T3, UniTask> callback);
        void Listen<T1, T2, T3, T4>(string eventName, Func<T1, T2, T3, T4, UniTask> callback);
        void Listen<T1, T2, T3, T4, T5>(string eventName, Func<T1, T2, T3, T4, T5, UniTask> callback);
        void Listen<T1, T2, T3, T4, T5, T6>(string eventName, Func<T1, T2, T3, T4, T5, T6, UniTask> callback);
        void Listen<T1, T2, T3, T4, T5, T6, T7>(string eventName, Func<T1, T2, T3, T4, T5, T6, T7, UniTask> callback);
        void Listen<T1, T2, T3, T4, T5, T6, T7, T8>(string eventName, Func<T1, T2, T3, T4, T5, T6, T7, T8, UniTask> callback);
    }
}